This is a very, very simple implementation of pipes for the Mac. Terribly simple. It provides a simple layer over the fopen and fclose functions in stdio.h that allows you to write pipe-dependent code; it may or may not be of any use to you and in any case was written as a quick and dirty hack. I know it compiles under CW9; other than that, I can guarantee nothing.
It consists of two functions:
FILE popen(const char *fn, const char *mode);
Opens a pipe by the name of fn and returns a file pointer to it. It is read and written with fprintf and fscanf just like any other file; this behavior is probably different from the UNIX implementation (which I haven't really used), but I wasn't sure whether or not to use freopen() (I didn't; if anyone wants to use this code and feels I should have done it differently, tell me how).
int pclose(FILE *pf);
Passes in the file pointer referring to the pipe you wish to close and closes the file associated with it.